<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:66:"E:\wamp\www\TP52\tp5\public/../application/index\view\Pay\pay.html";i:1528095062;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>确认订单页</title>
	<link href="/static/home/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css" />

		<link href="/static/home/basic/css/demo.css" rel="stylesheet" type="text/css" />
		<link href="/static/home/css/cartstyle.css" rel="stylesheet" type="text/css" />

		<link href="/static/home/css/jsstyle.css" rel="stylesheet" type="text/css" />

		<script type="text/javascript" src="/static/home/js/address.js"></script>
					<div class="concent">
</head>
<body>
		
		

		<!--顶部导航条 -->
		<div class="am-container header">
			<ul class="message-r">
				<div class="topMessage home">
					<div class="menu-hd"><a href="#" target="_top" class="h">商城首页</a></div>
				</div>
				<div class="topMessage my-shangcheng">
					<div class="menu-hd MyShangcheng"><a href="#" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a></div>
				</div>
				<div class="topMessage mini-cart">
					<div class="menu-hd"><a id="mc-menu-hd" href="#" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h">0</strong></a></div>
				</div>
				<div class="topMessage favorite">
					<div class="menu-hd"><a href="#" target="_top"><i class="am-icon-heart am-icon-fw"></i><span>收藏夹</span></a></div>
			</ul>
			</div>

			<!--悬浮搜索框-->

			<div class="nav white">
				<div class="logoBig" style="position:relative;top:-15px;right:0px;"> 
			     <li><img src="/static/home/images/aishang.png" /></li> 
			    </div> 
				<div class="search-bar pr">
					<a name="index_none_header_sysc" href="#"></a>
					<form action="/home/goods" method="post"> 
				      <input id="searchInput" name="search" type="text" placeholder="搜索" autocomplete="off" /> 
				      <input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit" /> 
				     </form> 
				</div>
			</div>

			<div class="clear"></div>
            <b class="line"></b>
			<div class="listMain">

				<!--分类-->
			<div class="nav-table">
					   <div class="long-title"><span class="all-goods">全部分类</span></div>
					   <div class="nav-cont">
							<ul>
								<li class="index"><a href="/home/index">首页</a></li>
                               <?php if(is_array($brand) || $brand instanceof \think\Collection || $brand instanceof \think\Paginator): if( count($brand)==0 ) : echo "" ;else: foreach($brand as $key=>$bra): ?>
      								<li class="qc"><a href="/home/brand/id/<?php echo $bra['id']; ?>"><?php echo $bra['brand']; ?></a></li>
  								<?php endforeach; endif; else: echo "" ;endif; ?>
							</ul>
						    <div class="nav-extra">
						    	<i class="am-icon-user-secret am-icon-md nav-user"></i><b></b>我的福利
						    	<i class="am-icon-angle-right" style="padding-left: 10px;"></i>
						    </div>
						</div>
			</div>
			<br>
				<ol class="am-breadcrumb am-breadcrumb-slash">
					<li><a href="#">首页</a></li>
					<li><a href="#">分类</a></li>
					<li class="am-active">购物车</li>
				</ol>
				<script type="text/javascript">
					$(function() {});
					$(window).load(function() {
						$('.flexslider').flexslider({
							animation: "slide",
							start: function(slider) {
								$('body').removeClass('loading');
							}
						});
					});
				</script>


				<!--地址 -->
				<div class="paycont">
					<div class="address">
						<h3>确认收货地址 </h3>
						<div class="control">
							<div class="tc-btn createAddr theme-login am-btn am-btn-danger">使用新地址</div>
						</div>
						<div class="clear"></div>
						<ul>
						 <?php if(is_array($address) || $address instanceof \think\Collection || $address instanceof \think\Paginator): if( count($address)==0 ) : echo "" ;else: foreach($address as $key=>$r): ?>
							<div class="per-border"></div>
							<li class="user-addresslist">
								<div class="address-left">
									<div class="user DefaultAddr">

										<span class="buy-address-detail">   
                   						<span class="buy-user"><?php echo $r['name']; ?> </span>
										<span class="buy-phone"><?php echo $r['phone']; ?></span>

										</span>
									</div>
									<div class="default-address DefaultAddr">
										<span class="buy-line-title buy-line-title-type">收货地址：</span>
										<span class="buy--address-detail">
								   			<?php echo $r['huo']; ?><?php echo $r['adds']; ?>
										</span>

										</span>
									</div>
									<ins class="deftip hidden">默认地址</ins>
								</div>
								<div class="address-right">
									<span class="am-icon-angle-right am-icon-lg"></span>
								</div>
								<div class="clear"></div>

								<div class="new-addr-btn">
									<a href="#">设为默认</a>
									<span class="new-addr-bar">|</span>
									<a href="#">编辑</a>
									<span class="new-addr-bar">|</span>
									<a href="javascript:void(0);"  onclick="delClick(this);">删除</a>
								</div>
							

							</li>
							<span hidden><?php echo $r['id']; ?></span>
						<?php endforeach; endif; else: echo "" ;endif; ?>

						</ul>

						<div class="clear"></div>
					</div>
					<!--物流 -->
					<div class="logistics">
						<h3>选择物流方式</h3>
						<ul class="op_express_delivery_hot">
							<li data-value="yuantong" class="OP_LOG_BTN  "><i class="c-gap-right" style="background-position:0px -468px"></i>圆通<span></span></li>
							<li data-value="shentong" class="OP_LOG_BTN  "><i class="c-gap-right" style="background-position:0px -1008px"></i>申通<span></span></li>
							<li data-value="yunda" class="OP_LOG_BTN  "><i class="c-gap-right" style="background-position:0px -576px"></i>韵达<span></span></li>
							<li data-value="zhongtong" class="OP_LOG_BTN op_express_delivery_hot_last "><i class="c-gap-right" style="background-position:0px -324px"></i>中通<span></span></li>
							<li data-value="shunfeng" class="OP_LOG_BTN  op_express_delivery_hot_bottom"><i class="c-gap-right" style="background-position:0px -180px"></i>顺丰<span></span></li>
						</ul>
					</div>
					<div class="clear"></div>

					<!--支付方式-->
					<div class="logistics">
						<h3>选择支付方式</h3>
						<ul class="pay-list">
							<li class="pay card"><img src="/static/home/images/wangyin.jpg" />银联<span></span></li>
							<li class="pay qq"><img src="/static/home/images/weizhifu.jpg" />微信<span></span></li>
							<li class="pay taobao"><img src="/static/home/images/zhifubao.jpg" />支付宝<span></span></li>
						</ul>
					</div>
					<div class="clear"></div>

					<!--订单 -->
					<div class="concent">
						<div id="payTable">
							<h3>确认订单信息</h3>
							<div class="cart-table-th">
								<div class="wp">

									<div class="th th-item">
										<div class="td-inner">商品信息</div>
									</div>
									<div class="th th-price">
										<div class="td-inner">单价</div>
									</div>
									<div class="th th-amount">
										<div class="td-inner">数量</div>
									</div>
									<div class="th th-sum">
										<div class="td-inner">金额</div>
									</div>
									<div class="th th-oplist">
										<div class="td-inner">配送方式</div>
									</div>

								</div>
							</div>
							<div class="clear"></div>
							<?php if(is_array($cart) || $cart instanceof \think\Collection || $cart instanceof \think\Paginator): if( count($cart)==0 ) : echo "" ;else: foreach($cart as $key=>$row): ?>
							<tr class="item-list">
								<div class="bundle  bundle-last">

									<div class="bundle-main">
										<ul class="item-content clearfix">
											<div class="pay-phone">
												<li class="td td-item">
													<div class="item-pic">
														<a href="#" class="J_MakePoint">
															<img src="/uploads/<?php echo $row['pic']; ?>" class="itempic J_ItemImg"></a>
													</div>
													<div class="item-info">
														<div class="item-basic-info">
															<a href="#" class="item-title J_MakePoint" data-point="tbcart.8.11"><?php echo $row['name']; ?></a>
														</div>
													</div>
												</li>
												<li class="td td-info">
													<div class="item-props">
														<span class="sku-line"><?php echo $row['descr']; ?></span>
														
													</div>
												</li>
												<li class="td td-price">
													<div class="item-price price-promo-promo">
														<div class="price-content">
															<em class="J_Price price-now"><?php echo $row['price']; ?></em>
														</div>
													</div>
												</li>
											</div>
											<li class="td td-amount">
												<div class="amount-wrapper ">
													<div class="item-amount ">
														<span class="phone-title">购买数量</span>
														<div class="sl">
															
															<em class="J_Price price-now"><?php echo $row['num']; ?></em>
															
														</div>
													</div>
												</div>
											</li>
											<li class="td td-sum">
												<div class="td-inner">
													<em tabindex="0" class="J_ItemSum number"><?php echo $row['num']*$row['price']; ?></em>
												</div>
											</li>
											<li class="td td-oplist">
												<div class="td-inner">
													<span class="phone-title">配送方式</span>
													<div class="pay-logis">
														快递<b class="sys_item_freprice">10</b>元
													</div>
												</div>
											</li>

										</ul>
										<div class="clear"></div>

									</div>
							</tr>

							<?php endforeach; endif; else: echo "" ;endif; ?>
							<div class="clear"></div>
							</div>

						
							<div class="clear"></div>
							<div class="pay-total">
						<!--留言-->
							<div class="order-extra">
								<div class="order-user-info">
									<div id="holyshit257" class="memo">
										<label>买家留言：</label>
										<input type="text" title="选填,对本次交易的说明（建议填写已经和卖家达成一致的说明）" placeholder="选填,建议填写和卖家达成一致的说明" class="memo-input J_MakePoint c2c-text-default memo-close">
										<div class="msg hidden J-msg">
											<p class="error">最多输入500个字符</p>
										</div>
									</div>
								</div>

							</div>
							<!--优惠券 -->
							<!-- <div class="buy-agio">
								<li class="td td-coupon">

									<span class="coupon-title">优惠券</span>
									<select data-am-selected>
										<option value="a">
											<div class="c-price">
												<strong>￥8</strong>
											</div>
											<div class="c-limit">
												【消费满95元可用】
											</div>
										</option>
										<option value="b" selected>
											<div class="c-price">
												<strong>￥3</strong>
											</div>
											<div class="c-limit">
												【无使用门槛】
											</div>
										</option>
									</select>
								</li>

								<li class="td td-bonus">

									<span class="bonus-title">红包</span>
									<select data-am-selected>
										<option value="a">
											<div class="item-info">
												¥50.00<span>元</span>
											</div>
											<div class="item-remainderprice">
												<span>还剩</span>10.40<span>元</span>
											</div>
										</option>
										<option value="b" selected>
											<div class="item-info">
												¥50.00<span>元</span>
											</div>
											<div class="item-remainderprice">
												<span>还剩</span>50.00<span>元</span>
											</div>
										</option>
									</select>

								</li>

							</div> -->
							<?php if($coupon!=null): ?>
							<div class="clear" style="color:red;">已自动使用优惠卷</div>
							</div>
							<!--含运费小计 -->
							<div class="buy-point-discharge ">
								<p class="price g_price ">
								
									合计（含运费） <span>¥</span><em class="pay-sum">
									<?php echo $allprice.'-'.$price['price'].'='; ?>
									<?php echo $allprice.'-'.$price['price'].'='.$allprice-$price['price']; ?></em>
									</p>
								</div>
								<?php else: ?>
								<div class="clear" style="color:red;">您没有可使用的优惠卷</div>
								</div>
								<!--含运费小计 -->
								<div class="buy-point-discharge ">
									<p class="price g_price ">
									合计（含运费） <span>¥</span><em class="pay-sum"><?php echo $allprice; ?></em>
									</p>
								</div>
								<?php endif; ?>

							<!--信息 -->
							<div class="order-go clearfix">
								<div class="pay-confirm clearfix">
									

									<div id="holyshit269" class="submitOrder">
										<div class="go-btn-wrap">
											<a id="submit" href="/pay/error" class="btn-go" tabindex="0" title="点击此按钮，提交订单">提交订单</a>
										</div>
									</div>
									<div class="clear"></div>
								</div>
							</div>
						</div>

						<div class="clear"></div>
					</div>
				</div>
		
		<?php echo widget("Cate/footer"); ?>

<div class="theme-popover-mask"></div>
			<div class="theme-popover">

				<!--标题 -->
				<div class="am-cf am-padding">
					<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">新增地址</strong> / <small>Add address</small></div>
				</div>
				<hr/>



				<div class="am-u-md-12">
					<form class="am-form am-form-horizontal" action="/pay/insertaddress" method="post">

						<div class="am-form-group">
							<label for="user-name" class="am-form-label">收货人</label>
							<div class="am-form-content">
								<input type="text" id="user-name" placeholder="收货人"name="name">
							</div>
						</div>

						<div class="am-form-group">
							<label for="user-phone" class="am-form-label">手机号码</label>
							<div class="am-form-content">
								<input id="user-phone" placeholder="手机号必填" type="text" name="phone">
							</div>
						</div>

						<div class="am-form-group">
							<label for="user-phone" class="am-form-label">所在地</label>
							<div class="am-form-content address">
								<select  id="sid">
									<option value="" class="ss">--请选择--</option>
								</select>
								  <input type="hidden" name="huo" value="">
							</div>
						</div>

						<div class="am-form-group">
							<label for="user-intro" class="am-form-label">详细地址</label>
							<div class="am-form-content">
								<textarea class="" rows="3" id="user-intro" placeholder="输入详细地址" name="adds"></textarea>
								<small>100字以内写出你的详细地址...</small>
							</div>
						</div>

						<div class="am-form-group theme-poptit">
							<div class="am-u-sm-9 am-u-sm-push-3">
								<button class="am-btn am-btn-danger">保存</button>
								<div class="am-btn am-btn-danger close">取消</div>
							</div>
						</div>
					</form>



				</div>

			</div>

			<div class="clear"></div>
</body>

<script type="text/javascript">
	// 第一级别获取
	$.get('/pay/two',{upid:0},function(data){
		//console.log(data);
		//将请选择禁止使用
		$('.ss').attr('disabled',true);
		//得到数据数组内容 我们需要遍历得到里面内容
		for(var i = 0;i<data.length;i++){
			//console.log(data[i].name);
			//遍历到option标签中
			var info =$('<option value="'+data[i].id+'">'+data[i].name+'</option>');
			//console.log(info);
			//将得到的option对象添加到select对象中
			$('#sid').append(info);
		}
	},'json');

	//其他级别
	$('select').live('change',function(){
		 //alert($(this).val());
		ob = $(this);
		//清除其他 select
		ob.nextAll('select').remove();
		id = ob.val();
		$.getJSON('/pay/two',{upid:id},function(data){
			//console.log(data);
			var select = $('<select></select>');
			var op = $('<option value="" class="mm">-请选择-</option>');
			select.append(op);
			for(var i=0;i<data.length;i++){
				var info =$('<option value="'+data[i].id+'">'+data[i].name+'</option>');
				//console.log(info);
				select.append(info);
			}

			ob.after(select);
			//把其他级别的请选择禁用掉
			 $('.mm').attr('disabled',true);
		})

	})

	//获取选中的数据提交到操作页面
	$('button').click(function(){
		arr=[];
		//console.log($("select"));
		//遍历select
		$('select').each(function(){
			//获取选中的数据
			sedata = $(this).find('option:selected').html();
			//console.log(sedata);

			arr.push(sedata);
			//console.log(arr);

		})
		//删除最有一个数组请选择
	 	arr.pop();
		//console.log(arr);
		//把数据赋值给隐藏域value
		$("input[name='huo']").val(arr);
	})

	$(".user-addresslist").click(function(){
		ob=$(this);
		a=ob.next("span").html();
		// alert(a);
		$("#submit").attr("href","/pay/addorder/id/"+a)
	})

</script>
</html>